package org.deschutter.exceptions;

import java.math.BigDecimal;

/**
 * User: Berten De Schutter
 * Date: 08-Jul-2009
 * Time: 14:55:34
 */
public class AddShipsToScanException extends Exception {
    String mistake;
    private String name, scanID;
    private BigDecimal amount;

    public AddShipsToScanException() {
        super();             // call superclass constructor
        mistake = "unknown";
    }


    public AddShipsToScanException(String err) {
        super(err);     // call super class constructor
        mistake = err;  // save message
    }


    public AddShipsToScanException(String err, String scanID, String name, BigDecimal amount) {
        super(err);     // call super class constructor
        mistake = err;  // save message
        this.scanID = scanID;
        this.name = name;
        this.amount = amount;
    }


    public String getError() {

        if (scanID == null) {
            return mistake;
        } else {
            return "[ADD SHIPS TO SCAN EXCEPTION] Scan Id:" + scanID + " Ship: " + name + " Amount" + amount;
        }
    }

    public String getMistake() {
        return mistake;
    }

    public void setMistake(String mistake) {
        this.mistake = mistake;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getScanID() {
        return scanID;
    }

    public void setScanID(String scanID) {
        this.scanID = scanID;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }
}
